Skip to content

test: improve coverage for hosting implicit SDK initialization#10360

Open
joehan wants to merge 2 commits intomainfrom
test/hosting-implicit-init
Open

test: improve coverage for hosting implicit SDK initialization#10360
joehan wants to merge 2 commits intomainfrom
test/hosting-implicit-init

Conversation

@joehan
Copy link
Copy Markdown
Member

@joehan joehan commented Apr 16, 2026

Description

Mock dynamic frontend script variable substitution logic for init flows.

Scenarios Tested

  • Emulators loading and formatting templates

### Description
Mock dynamic frontend script variable substitution logic for init flows.

### Scenarios Tested
- Emulators loading and formatting templates
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@joehan
Copy link
Copy Markdown
Member Author

joehan commented Apr 20, 2026

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new test suite for the hosting/implicitInit module, covering scenarios such as successful configuration fetching, fallback to cached setup on authentication errors, handling of missing configurations, and emulator list population. Feedback was provided to replace the use of the any type in test error handling with a more specific intersection type to adhere to the repository's style guide.

});

it("should fallback to cache if fetch fails with 403", async () => {
const err: any = new Error("Auth failed");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Avoid using any as an escape hatch, as per the repository style guide (Line 38). You can use a more specific type or an intersection type to define the expected error structure for testing purposes.

Suggested change
const err: any = new Error("Auth failed");
const err = new Error("Auth failed") as Error & { context: { response: { statusCode: number } } };
References
  1. Never use any or unknown as an escape hatch. Define proper interfaces/types or use type guards. (link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants